unit FPassword;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ExtCtrls, StdCtrls, Buttons, Mask, Menus;

type
  TFormFPassword = class(TForm)
    Label1: TLabel;
    EditPassword: TMaskEdit;
    BtnOK: TBitBtn;
    BtnCancel: TBitBtn;
    LabelTitle: TLabel;
    Bevel1: TBevel;
    Bevel2: TBevel;
    Memo1: TMemo;
    BtnNone: TBitBtn;
    CheckInfo: TCheckBox;
    procedure EditPasswordKeyPress(Sender: TObject; var Key: Char);
    procedure FormCreate(Sender: TObject);
    procedure EditPasswordChange(Sender: TObject);
    procedure BtnOKClick(Sender: TObject);
    procedure Memo1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    password: string;
    procedure BigScreen;
  end;

var
  FormFPassword: TFormFPassword;

implementation

{$R *.DFM}

procedure TFormFPassword.FormCreate(Sender: TObject);
begin
  password:='<NIL>';
  height:=140;
end;

procedure TFormFPassword.EditPasswordKeyPress(Sender: TObject;
  var Key: Char);
begin
  if key = #13 then begin
      if EditPassword.text <> '' then BtnOK.click;
    key:=#0;
  end;
end;                                   

procedure TFormFPassword.EditPasswordChange(Sender: TObject);
begin
  if EditPassword.text = '' then BtnOK.enabled:=false else BtnOK.enabled:=true;
end;

procedure TFormFPassword.BtnOKClick(Sender: TObject);
begin
  case TComponent(sender).tag of
    0: password:='';
    1: password:=EditPassword.text;
    2: password:='<NIL>';
  end;
  close;
end;

procedure TFormFPassword.BigScreen;
begin
  height:=236;
end;

procedure TFormFPassword.Memo1Click(Sender: TObject);
begin
  if BtnOK.enabled then BtnOK.setfocus else BtnCancel.setfocus;
end;

end.
